solve problems involving sequence